home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Online / NNTPd / server / profile.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-03  |  383 b   |  27 lines

  1. #ifndef lint
  2. static char    sccsid[] = "@(#)profile.c    1.1    (Berkeley) 12/18/87";
  3. #endif
  4.  
  5. #include <sys/types.h>
  6. #include <sys/stat.h>
  7.  
  8. #define    MON    "gmon.out"
  9. #define    DIR    "/tmp/nntpd.prof"
  10.  
  11. void
  12. profile()
  13. {
  14.     static char    tmp[] = "gmon.XXXXXX";
  15.     struct stat    statbuf;
  16.  
  17.     if (chdir(DIR) < 0)
  18.         return;
  19.  
  20.     if (stat(MON, statbuf) < 0)
  21.         return;
  22.  
  23.     (void) mktemp(tmp);
  24.  
  25.     (void) rename(MON, tmp);
  26. }
  27.